package com.pysoft.cms.service.impl;

import java.util.List;

import com.pysoft.cms.dao.entity.Catalog;
import com.pysoft.cms.dao.entity.CatalogExample;
import com.pysoft.cms.dao.mapper.CatalogMapper;
import com.pysoft.cms.exception.ServiceException;
import com.pysoft.cms.service.CatalogService;

public class CatalogServiceImpl implements CatalogService {
	private CatalogMapper mapper;


	public CatalogMapper getMapper() {
		return mapper;
	}

	public void setMapper(CatalogMapper mapper) {
		this.mapper = mapper;
	}

	@Override
	public List<Catalog> query(Long siteId) throws ServiceException {
		CatalogExample p = new CatalogExample();
		p.createCriteria().andSiteidEqualTo(siteId);
		return this.getMapper().selectByExample(p);
	}

	@Override
	public Catalog create(Catalog catalog) throws ServiceException {
		this.getMapper().insertSelective(catalog);
		return catalog;
	}

	@Override
	public void delete() throws ServiceException {
		
	}

	@Override
	public void modify(Catalog catalog) throws ServiceException {
		this.getMapper().updateByPrimaryKey(catalog);
		
	}

	
}
